package com.arron.algorithm.huawei.简单;

import java.util.Scanner;

public class 简单密码 {


        public static void main(String[] args) {
            String  table = "abcdefgghijklmnopqrstuvwxyz";
            Character[] arrays = new Character[26];
            for (int i = 0; i < table.length(); i++) {
                arrays[table.charAt(i) - 'a'] = table.charAt(i);
            }

            Scanner in = new Scanner(System.in);
            // 注意 hasNext 和 hasNextLine 的区别

            String a = in.nextLine();
            a.replace("a","b");
            char[] chars =  a.toCharArray();
            StringBuffer res = new StringBuffer();
            for (int i = 0; i < chars.length; i++) {
                if (Character.isDigit(chars[i])) {
                    res.append(chars[i]);
                    continue;
                }
                if (Character.toUpperCase(chars[i]) == chars[i]) {
                    //如果是大写；
                    int index =  Character.toLowerCase(chars[i]) - 'a';

                    res.append( arrays[index == 25 ? 0 : index + 1]);
                } else {
                    res.append(mapToInt(chars[i]));
                }
            }


            System.out.println(res.toString());
        }

        public static int mapToInt(char a) {

            if (a == 'a' || a == 'b' || a == 'c') {
                return 2;
            } else if (a == 'd' || a == 'e' || a == 'f') {
                return 3;
            } else if (a == 'g' || a == 'h' || a == 'i') {
                return 4;
            } else if (a == 'm' || a == 'n' || a == 'o') {
                return 6;
            } else if (a == 'j' || a == 'k' || a == 'l') {
                return 5;
            } else if (a == 'p' || a == 'q' || a == 'r' || a == 's') {
                return 7;
            } else if (a == 't' || a == 'u' || a == 'v') {
                return 8;
            } else if (a == 'w' || a == 'x' || a == 'y' || a == 'z') {
                return 9;
            }
            return 0;
        }



}
